<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">--</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Makefile Dependency Generation</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- (c) The University of Glasgow 2005</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Driver.MakeFile</span><span>
</span><span id="line-12"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.MakeFile.html#doMkDependHS"><span class="hs-identifier">doMkDependHS</span></a></span><span>
</span><span id="line-13"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-14"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.html"><span class="hs-identifier">GHC</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html"><span class="hs-identifier">GHC.Driver.Monad</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.SysTools.html"><span class="hs-identifier">GHC.SysTools</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SysTools</span></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Graph.Directed.html"><span class="hs-identifier">GHC.Data.Graph.Directed</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier">SCC</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html"><span class="hs-identifier">GHC.Driver.Finder</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.SysTools.FileCleanup.html"><span class="hs-identifier">GHC.SysTools.FileCleanup</span></a></span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Exception.html"><span class="hs-identifier">GHC.Utils.Exception</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#"><span class="hs-identifier">System.IO.Error</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#isEOFError"><span class="hs-identifier">isEOFError</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier">when</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier">forM_</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier">isJust</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-49"></span><span class="hs-comment">--</span><span>
</span><span id="line-50"></span><span class="hs-comment">--              The main function</span><span>
</span><span id="line-51"></span><span class="hs-comment">--</span><span>
</span><span id="line-52"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span id="local-6989586621681211102"><span class="annot"><a href="GHC.Driver.MakeFile.html#doMkDependHS"><span class="hs-identifier hs-type">doMkDependHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681211102"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681211102"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-55"></span><span id="doMkDependHS"><span class="annot"><span class="annottext">doMkDependHS :: forall (m :: * -&gt; *). GhcMonad m =&gt; [FilePath] -&gt; m ()
</span><a href="GHC.Driver.MakeFile.html#doMkDependHS"><span class="hs-identifier hs-var hs-var">doMkDependHS</span></a></span></span><span> </span><span id="local-6989586621681210870"><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210870"><span class="hs-identifier hs-var">srcs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-comment">-- Initialisation</span><span>
</span><span id="line-57"></span><span>    </span><span id="local-6989586621681210869"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210869"><span class="hs-identifier hs-var">dflags0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier hs-var">GHC.getSessionDynFlags</span></a></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-comment">-- We kludge things a bit for dependency generation. Rather than</span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-comment">-- generating dependencies for each way separately, we generate</span><span>
</span><span id="line-61"></span><span>    </span><span class="hs-comment">-- them once and then duplicate them for each way's osuf/hisuf.</span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-comment">-- We therefore do the initial dependency generation with an empty</span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-comment">-- way and .o/.hi extensions, regardless of any flags that might</span><span>
</span><span id="line-64"></span><span>    </span><span class="hs-comment">-- be specified.</span><span>
</span><span id="line-65"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210867"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210869"><span class="hs-identifier hs-var">dflags0</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-66"></span><span>                     </span><span class="annot"><span class="annottext">ways :: Set Way
</span><a href="GHC.Driver.Session.html#ways"><span class="hs-identifier hs-var">ways</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set Way
forall a. Set a
</span><a href="../../containers/src/Data.Set.Internal.html#empty"><span class="hs-identifier hs-var">Set.empty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>                     </span><span class="annot"><span class="annottext">hiSuf :: FilePath
</span><a href="GHC.Driver.Session.html#hiSuf"><span class="hs-identifier hs-var">hiSuf</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;hi&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-68"></span><span>                     </span><span class="annot"><span class="annottext">objectSuf :: FilePath
</span><a href="GHC.Driver.Session.html#objectSuf"><span class="hs-identifier hs-var">objectSuf</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;o&quot;</span></span><span>
</span><span id="line-69"></span><span>                 </span><span class="hs-special">}</span><span>
</span><span id="line-70"></span><span>    </span><span class="annot"><span class="annottext">DynFlags -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#setSessionDynFlags"><span class="hs-identifier hs-var">GHC.setSessionDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; m () -&gt; m ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[FilePath] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; [FilePath]
</span><a href="GHC.Driver.Session.html#depSuffixes"><span class="hs-identifier hs-var hs-var">depSuffixes</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m () -&gt; m ()) -&gt; m () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-73"></span><span>        </span><span class="annot"><span class="annottext">GhcException -&gt; IO ()
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;You must specify at least one -dep-suffix&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span>    </span><span id="local-6989586621681210856"><span class="annot"><span class="annottext">MkDepFiles
</span><a href="#local-6989586621681210856"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO MkDepFiles -&gt; m MkDepFiles
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO MkDepFiles -&gt; m MkDepFiles) -&gt; IO MkDepFiles -&gt; m MkDepFiles
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO MkDepFiles
</span><a href="GHC.Driver.MakeFile.html#beginMkDependHS"><span class="hs-identifier hs-var">beginMkDependHS</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span>    </span><span class="hs-comment">-- Do the downsweep to find all the modules</span><span>
</span><span id="line-78"></span><span>    </span><span id="local-6989586621681210854"><span class="annot"><span class="annottext">[Target]
</span><a href="#local-6989586621681210854"><span class="hs-identifier hs-var">targets</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; m Target) -&gt; [FilePath] -&gt; m [Target]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681210852"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210852"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe Phase -&gt; m Target
forall (m :: * -&gt; *).
GhcMonad m =&gt;
FilePath -&gt; Maybe Phase -&gt; m Target
</span><a href="GHC.html#guessTarget"><span class="hs-identifier hs-var">GHC.guessTarget</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210852"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Phase
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210870"><span class="hs-identifier hs-var">srcs</span></a></span><span>
</span><span id="line-79"></span><span>    </span><span class="annot"><span class="annottext">[Target] -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; [Target] -&gt; m ()
</span><a href="GHC.html#setTargets"><span class="hs-identifier hs-var">GHC.setTargets</span></a></span><span> </span><span class="annot"><span class="annottext">[Target]
</span><a href="#local-6989586621681210854"><span class="hs-identifier hs-var">targets</span></a></span><span>
</span><span id="line-80"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210849"><span class="annot"><span class="annottext">excl_mods :: [ModuleName]
</span><a href="#local-6989586621681210849"><span class="hs-identifier hs-var hs-var">excl_mods</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [ModuleName]
</span><a href="GHC.Driver.Session.html#depExcludeMods"><span class="hs-identifier hs-var hs-var">depExcludeMods</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-81"></span><span>    </span><span id="local-6989586621681210847"><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681210847"><span class="hs-identifier hs-var">module_graph</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ModuleName] -&gt; Bool -&gt; m ModuleGraph
forall (m :: * -&gt; *).
GhcMonad m =&gt;
[ModuleName] -&gt; Bool -&gt; m ModuleGraph
</span><a href="GHC.Driver.Make.html#depanal"><span class="hs-identifier hs-var">GHC.depanal</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681210849"><span class="hs-identifier hs-var">excl_mods</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-comment">{- Allow dup roots -}</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>    </span><span class="hs-comment">-- Sort into dependency order</span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-comment">-- There should be no cycles</span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210845"><span class="annot"><span class="annottext">sorted :: [SCC ModSummary]
</span><a href="#local-6989586621681210845"><span class="hs-identifier hs-var hs-var">sorted</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; ModuleGraph -&gt; Maybe ModuleName -&gt; [SCC ModSummary]
</span><a href="GHC.Driver.Make.html#topSortModuleGraph"><span class="hs-identifier hs-var">GHC.topSortModuleGraph</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681210847"><span class="hs-identifier hs-var">module_graph</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span>    </span><span class="hs-comment">-- Print out the dependencies if wanted</span><span>
</span><span id="line-88"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-var">debugTraceMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Module dependencies&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC ModSummary] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC ModSummary]
</span><a href="#local-6989586621681210845"><span class="hs-identifier hs-var">sorted</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span>    </span><span class="hs-comment">-- Process them one by one, dumping results into makefile</span><span>
</span><span id="line-91"></span><span>    </span><span class="hs-comment">-- and complaining about cycles</span><span>
</span><span id="line-92"></span><span>    </span><span id="local-6989586621681210839"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210839"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-93"></span><span>    </span><span id="local-6989586621681210837"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210837"><span class="hs-identifier hs-var">root</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO FilePath -&gt; m FilePath
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO FilePath
</span><a href="../../directory/src/System.Directory.html#getCurrentDirectory"><span class="hs-identifier hs-var">getCurrentDirectory</span></a></span><span>
</span><span id="line-94"></span><span>    </span><span class="annot"><span class="annottext">(SCC ModSummary -&gt; m ()) -&gt; [SCC ModSummary] -&gt; m ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ())
-&gt; (SCC ModSummary -&gt; IO ()) -&gt; SCC ModSummary -&gt; m ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; HscEnv
-&gt; [ModuleName]
-&gt; FilePath
-&gt; Handle
-&gt; SCC ModSummary
-&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#processDeps"><span class="hs-identifier hs-var">processDeps</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210839"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681210849"><span class="hs-identifier hs-var">excl_mods</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210837"><span class="hs-identifier hs-var">root</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MkDepFiles -&gt; Handle
</span><a href="GHC.Driver.MakeFile.html#mkd_tmp_hdl"><span class="hs-identifier hs-var hs-var">mkd_tmp_hdl</span></a></span><span> </span><span class="annot"><span class="annottext">MkDepFiles
</span><a href="#local-6989586621681210856"><span class="hs-identifier hs-var">files</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SCC ModSummary]
</span><a href="#local-6989586621681210845"><span class="hs-identifier hs-var">sorted</span></a></span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span>    </span><span class="hs-comment">-- If -ddump-mod-cycles, show cycles in the module graph</span><span>
</span><span id="line-97"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleGraph -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#dumpModCycles"><span class="hs-identifier hs-var">dumpModCycles</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681210847"><span class="hs-identifier hs-var">module_graph</span></a></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span>    </span><span class="hs-comment">-- Tidy up</span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MkDepFiles -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#endMkDependHS"><span class="hs-identifier hs-var">endMkDependHS</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210867"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">MkDepFiles
</span><a href="#local-6989586621681210856"><span class="hs-identifier hs-var">files</span></a></span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span>    </span><span class="hs-comment">-- Unconditional exiting is a bad idea.  If an error occurs we'll get an</span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-comment">--exception; if that is not caught it's fine, but at least we have a</span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-comment">--chance to find out exactly what went wrong.  Uncomment the following</span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-comment">--line if you disagree.</span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-comment">--`GHC.ghcCatch` \_ -&gt; io $ exitWith (ExitFailure 1)</span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-110"></span><span class="hs-comment">--</span><span>
</span><span id="line-111"></span><span class="hs-comment">--              beginMkDependHs</span><span>
</span><span id="line-112"></span><span class="hs-comment">--      Create a temporary file,</span><span>
</span><span id="line-113"></span><span class="hs-comment">--      find the Makefile,</span><span>
</span><span id="line-114"></span><span class="hs-comment">--      slurp through it, etc</span><span>
</span><span id="line-115"></span><span class="hs-comment">--</span><span>
</span><span id="line-116"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-keyword">data</span><span> </span><span id="MkDepFiles"><span class="annot"><a href="GHC.Driver.MakeFile.html#MkDepFiles"><span class="hs-identifier hs-var">MkDepFiles</span></a></span></span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="MkDep"><span class="annot"><a href="GHC.Driver.MakeFile.html#MkDep"><span class="hs-identifier hs-var">MkDep</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="mkd_make_file"><span class="annot"><span class="annottext">MkDepFiles -&gt; FilePath
</span><a href="GHC.Driver.MakeFile.html#mkd_make_file"><span class="hs-identifier hs-var hs-var">mkd_make_file</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- Name of the makefile</span><span>
</span><span id="line-120"></span><span>            </span><span id="mkd_make_hdl"><span class="annot"><span class="annottext">MkDepFiles -&gt; Maybe Handle
</span><a href="GHC.Driver.MakeFile.html#mkd_make_hdl"><span class="hs-identifier hs-var hs-var">mkd_make_hdl</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span>      </span><span class="hs-comment">-- Handle for the open makefile</span><span>
</span><span id="line-121"></span><span>            </span><span id="mkd_tmp_file"><span class="annot"><span class="annottext">MkDepFiles -&gt; FilePath
</span><a href="GHC.Driver.MakeFile.html#mkd_tmp_file"><span class="hs-identifier hs-var hs-var">mkd_tmp_file</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- Name of the temporary file</span><span>
</span><span id="line-122"></span><span>            </span><span id="mkd_tmp_hdl"><span class="annot"><span class="annottext">MkDepFiles -&gt; Handle
</span><a href="GHC.Driver.MakeFile.html#mkd_tmp_hdl"><span class="hs-identifier hs-var hs-var">mkd_tmp_hdl</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-special">}</span><span>           </span><span class="hs-comment">-- Handle of the open temporary file</span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#beginMkDependHS"><span class="hs-identifier hs-type">beginMkDependHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.MakeFile.html#MkDepFiles"><span class="hs-identifier hs-type">MkDepFiles</span></a></span><span>
</span><span id="line-125"></span><span id="beginMkDependHS"><span class="annot"><span class="annottext">beginMkDependHS :: DynFlags -&gt; IO MkDepFiles
</span><a href="GHC.Driver.MakeFile.html#beginMkDependHS"><span class="hs-identifier hs-var hs-var">beginMkDependHS</span></a></span></span><span> </span><span id="local-6989586621681210825"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210825"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-126"></span><span>        </span><span class="hs-comment">-- open a new temp file in which to stuff the dependency info</span><span>
</span><span id="line-127"></span><span>        </span><span class="hs-comment">-- as we go along.</span><span>
</span><span id="line-128"></span><span>  </span><span id="local-6989586621681210824"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210824"><span class="hs-identifier hs-var">tmp_file</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; TempFileLifetime -&gt; FilePath -&gt; IO FilePath
</span><a href="GHC.SysTools.FileCleanup.html#newTempName"><span class="hs-identifier hs-var">newTempName</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210825"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">TempFileLifetime
</span><a href="GHC.SysTools.FileCleanup.html#TFL_CurrentModule"><span class="hs-identifier hs-var">TFL_CurrentModule</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;dep&quot;</span></span><span>
</span><span id="line-129"></span><span>  </span><span id="local-6989586621681210821"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210821"><span class="hs-identifier hs-var">tmp_hdl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IOMode -&gt; IO Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#openFile"><span class="hs-identifier hs-var">openFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210824"><span class="hs-identifier hs-var">tmp_file</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#WriteMode"><span class="hs-identifier hs-var">WriteMode</span></a></span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span>        </span><span class="hs-comment">-- open the makefile</span><span>
</span><span id="line-132"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210818"><span class="annot"><span class="annottext">makefile :: FilePath
</span><a href="#local-6989586621681210818"><span class="hs-identifier hs-var hs-var">makefile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath
</span><a href="GHC.Driver.Session.html#depMakefile"><span class="hs-identifier hs-var hs-var">depMakefile</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210825"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-133"></span><span>  </span><span id="local-6989586621681210816"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210816"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210818"><span class="hs-identifier hs-var">makefile</span></a></span><span>
</span><span id="line-134"></span><span>  </span><span id="local-6989586621681210814"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621681210814"><span class="hs-identifier hs-var">mb_make_hdl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-135"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210816"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-136"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe Handle -&gt; IO (Maybe Handle)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-137"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-138"></span><span>           </span><span id="local-6989586621681210812"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210812"><span class="hs-identifier hs-var">makefile_hdl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IOMode -&gt; IO Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#openFile"><span class="hs-identifier hs-var">openFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210818"><span class="hs-identifier hs-var">makefile</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#ReadMode"><span class="hs-identifier hs-var">ReadMode</span></a></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span>                </span><span class="hs-comment">-- slurp through until we get the magic start string,</span><span>
</span><span id="line-141"></span><span>                </span><span class="hs-comment">-- copying the contents into dep_makefile</span><span>
</span><span id="line-142"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210803"><span class="annot"><span class="annottext">slurp :: IO ()
</span><a href="#local-6989586621681210803"><span class="hs-identifier hs-var hs-var">slurp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-143"></span><span>                </span><span id="local-6989586621681210802"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210802"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO FilePath
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hGetLine"><span class="hs-identifier hs-var">hGetLine</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210812"><span class="hs-identifier hs-var">makefile_hdl</span></a></span><span>
</span><span id="line-144"></span><span>                </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210802"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="GHC.Driver.MakeFile.html#depStartMarker"><span class="hs-identifier hs-var">depStartMarker</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>                        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>                        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; FilePath -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStrLn"><span class="hs-identifier hs-var">hPutStrLn</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210821"><span class="hs-identifier hs-var">tmp_hdl</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210802"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681210803"><span class="hs-identifier hs-var">slurp</span></a></span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span>                </span><span class="hs-comment">-- slurp through until we get the magic end marker,</span><span>
</span><span id="line-149"></span><span>                </span><span class="hs-comment">-- throwing away the contents</span><span>
</span><span id="line-150"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210794"><span class="annot"><span class="annottext">chuck :: IO ()
</span><a href="#local-6989586621681210794"><span class="hs-identifier hs-var hs-var">chuck</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-151"></span><span>                </span><span id="local-6989586621681210793"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210793"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO FilePath
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hGetLine"><span class="hs-identifier hs-var">hGetLine</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210812"><span class="hs-identifier hs-var">makefile_hdl</span></a></span><span>
</span><span id="line-152"></span><span>                </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210793"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="GHC.Driver.MakeFile.html#depEndMarker"><span class="hs-identifier hs-var">depEndMarker</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-153"></span><span>                        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>                        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681210794"><span class="hs-identifier hs-var">chuck</span></a></span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span>           </span><span class="annot"><span class="annottext">IO () -&gt; (IOException -&gt; IO ()) -&gt; IO ()
forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="GHC.Utils.Exception.html#catchIO"><span class="hs-identifier hs-var">catchIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681210803"><span class="hs-identifier hs-var">slurp</span></a></span><span>
</span><span id="line-157"></span><span>                </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681210790"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210790"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isEOFError"><span class="hs-identifier hs-var">isEOFError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210790"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210790"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>           </span><span class="annot"><span class="annottext">IO () -&gt; (IOException -&gt; IO ()) -&gt; IO ()
forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="GHC.Utils.Exception.html#catchIO"><span class="hs-identifier hs-var">catchIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621681210794"><span class="hs-identifier hs-var">chuck</span></a></span><span>
</span><span id="line-159"></span><span>                </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681210788"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210788"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isEOFError"><span class="hs-identifier hs-var">isEOFError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210788"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210788"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span>           </span><span class="annot"><span class="annottext">Maybe Handle -&gt; IO (Maybe Handle)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Handle -&gt; Maybe Handle
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210812"><span class="hs-identifier hs-var">makefile_hdl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span>        </span><span class="hs-comment">-- write the magic marker into the tmp file</span><span>
</span><span id="line-165"></span><span>  </span><span class="annot"><span class="annottext">Handle -&gt; FilePath -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStrLn"><span class="hs-identifier hs-var">hPutStrLn</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210821"><span class="hs-identifier hs-var">tmp_hdl</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="GHC.Driver.MakeFile.html#depStartMarker"><span class="hs-identifier hs-var">depStartMarker</span></a></span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span>  </span><span class="annot"><span class="annottext">MkDepFiles -&gt; IO MkDepFiles
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MkDep :: FilePath -&gt; Maybe Handle -&gt; FilePath -&gt; Handle -&gt; MkDepFiles
</span><a href="GHC.Driver.MakeFile.html#MkDep"><span class="hs-identifier hs-type">MkDep</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mkd_make_file :: FilePath
</span><a href="GHC.Driver.MakeFile.html#mkd_make_file"><span class="hs-identifier hs-var">mkd_make_file</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210818"><span class="hs-identifier hs-var">makefile</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mkd_make_hdl :: Maybe Handle
</span><a href="GHC.Driver.MakeFile.html#mkd_make_hdl"><span class="hs-identifier hs-var">mkd_make_hdl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621681210814"><span class="hs-identifier hs-var">mb_make_hdl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-168"></span><span>                  </span><span class="annot"><span class="annottext">mkd_tmp_file :: FilePath
</span><a href="GHC.Driver.MakeFile.html#mkd_tmp_file"><span class="hs-identifier hs-var">mkd_tmp_file</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210824"><span class="hs-identifier hs-var">tmp_file</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mkd_tmp_hdl :: Handle
</span><a href="GHC.Driver.MakeFile.html#mkd_tmp_hdl"><span class="hs-identifier hs-var">mkd_tmp_hdl</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210821"><span class="hs-identifier hs-var">tmp_hdl</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-172"></span><span class="hs-comment">--</span><span>
</span><span id="line-173"></span><span class="hs-comment">--              processDeps</span><span>
</span><span id="line-174"></span><span class="hs-comment">--</span><span>
</span><span id="line-175"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#processDeps"><span class="hs-identifier hs-type">processDeps</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-178"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-179"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-180"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-181"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>           </span><span class="hs-comment">-- Write dependencies to here</span><span>
</span><span id="line-182"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier hs-type">SCC</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span>
</span><span id="line-183"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- Write suitable dependencies to handle</span><span>
</span><span id="line-185"></span><span class="hs-comment">-- Always:</span><span>
</span><span id="line-186"></span><span class="hs-comment">--                      this.o : this.hs</span><span>
</span><span id="line-187"></span><span class="hs-comment">--</span><span>
</span><span id="line-188"></span><span class="hs-comment">-- If the dependency is on something other than a .hi file:</span><span>
</span><span id="line-189"></span><span class="hs-comment">--                      this.o this.p_o ... : dep</span><span>
</span><span id="line-190"></span><span class="hs-comment">-- otherwise</span><span>
</span><span id="line-191"></span><span class="hs-comment">--                      this.o ...   : dep.hi</span><span>
</span><span id="line-192"></span><span class="hs-comment">--                      this.p_o ... : dep.p_hi</span><span>
</span><span id="line-193"></span><span class="hs-comment">--                      ...</span><span>
</span><span id="line-194"></span><span class="hs-comment">-- (where .o is $osuf, and the other suffixes come from</span><span>
</span><span id="line-195"></span><span class="hs-comment">-- the cmdline -s options).</span><span>
</span><span id="line-196"></span><span class="hs-comment">--</span><span>
</span><span id="line-197"></span><span class="hs-comment">-- For {-# SOURCE #-} imports the &quot;hi&quot; will be &quot;hi-boot&quot;.</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span id="processDeps"><span class="annot"><span class="annottext">processDeps :: DynFlags
-&gt; HscEnv
-&gt; [ModuleName]
-&gt; FilePath
-&gt; Handle
-&gt; SCC ModSummary
-&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#processDeps"><span class="hs-identifier hs-var hs-var">processDeps</span></a></span></span><span> </span><span id="local-6989586621681210787"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210787"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Handle
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span id="local-6989586621681210785"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210785"><span class="hs-identifier hs-var">nodes</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>  </span><span class="hs-glyph">=</span><span>     </span><span class="hs-comment">-- There shouldn't be any cycles; report them</span><span>
</span><span id="line-201"></span><span>    </span><span class="annot"><span class="annottext">GhcException -&gt; IO ()
forall a. GhcException -&gt; IO a
</span><a href="GHC.Utils.Panic.html#throwGhcExceptionIO"><span class="hs-identifier hs-var">throwGhcExceptionIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#ProgramError"><span class="hs-identifier hs-var">ProgramError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210787"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; FilePath) -&gt; MsgDoc -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary] -&gt; MsgDoc
</span><a href="GHC.Driver.Make.html#cyclicModuleErr"><span class="hs-identifier hs-var">GHC.cyclicModuleErr</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210785"><span class="hs-identifier hs-var">nodes</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#processDeps"><span class="hs-identifier hs-var">processDeps</span></a></span><span> </span><span id="local-6989586621681210782"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210782"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681210781"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210781"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681210780"><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681210780"><span class="hs-identifier hs-var">excl_mods</span></a></span></span><span> </span><span id="local-6989586621681210779"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210779"><span class="hs-identifier hs-var">root</span></a></span></span><span> </span><span id="local-6989586621681210778"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210778"><span class="hs-identifier hs-var">hdl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#AcyclicSCC"><span class="hs-identifier hs-type">AcyclicSCC</span></a></span><span> </span><span id="local-6989586621681210776"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-204"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210775"><span class="annot"><span class="annottext">extra_suffixes :: [FilePath]
</span><a href="#local-6989586621681210775"><span class="hs-identifier hs-var hs-var">extra_suffixes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [FilePath]
</span><a href="GHC.Driver.Session.html#depSuffixes"><span class="hs-identifier hs-var hs-var">depSuffixes</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210782"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-205"></span><span>              </span><span id="local-6989586621681210774"><span class="annot"><span class="annottext">include_pkg_deps :: Bool
</span><a href="#local-6989586621681210774"><span class="hs-identifier hs-var hs-var">include_pkg_deps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#depIncludePkgDeps"><span class="hs-identifier hs-var hs-var">depIncludePkgDeps</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210782"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-206"></span><span>              </span><span id="local-6989586621681210772"><span class="annot"><span class="annottext">src_file :: FilePath
</span><a href="#local-6989586621681210772"><span class="hs-identifier hs-var hs-var">src_file</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; FilePath
</span><a href="GHC.Driver.Types.html#msHsFilePath"><span class="hs-identifier hs-var">msHsFilePath</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span><span>
</span><span id="line-207"></span><span>              </span><span id="local-6989586621681210770"><span class="annot"><span class="annottext">obj_file :: FilePath
</span><a href="#local-6989586621681210770"><span class="hs-identifier hs-var hs-var">obj_file</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; FilePath
</span><a href="GHC.Driver.Types.html#msObjFilePath"><span class="hs-identifier hs-var">msObjFilePath</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span><span>
</span><span id="line-208"></span><span>              </span><span id="local-6989586621681210768"><span class="annot"><span class="annottext">obj_files :: [FilePath]
</span><a href="#local-6989586621681210768"><span class="hs-identifier hs-var hs-var">obj_files</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; [FilePath] -&gt; [FilePath]
</span><a href="GHC.Driver.MakeFile.html#insertSuffixes"><span class="hs-identifier hs-var">insertSuffixes</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210770"><span class="hs-identifier hs-var">obj_file</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210775"><span class="hs-identifier hs-var">extra_suffixes</span></a></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span>              </span><span id="local-6989586621681210762"><span class="annot"><span class="annottext">do_imp :: SrcSpan
-&gt; IsBootInterface -&gt; Maybe FastString -&gt; ModuleName -&gt; IO ()
</span><a href="#local-6989586621681210762"><span class="hs-identifier hs-var hs-var">do_imp</span></a></span></span><span> </span><span id="local-6989586621681210761"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681210761"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681210760"><span class="annot"><span class="annottext">IsBootInterface
</span><a href="#local-6989586621681210760"><span class="hs-identifier hs-var">is_boot</span></a></span></span><span> </span><span id="local-6989586621681210759"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681210759"><span class="hs-identifier hs-var">pkg_qual</span></a></span></span><span> </span><span id="local-6989586621681210758"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210758"><span class="hs-identifier hs-var">imp_mod</span></a></span></span><span>
</span><span id="line-211"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681210757"><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681210757"><span class="hs-identifier hs-var">mb_hi</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; SrcSpan
-&gt; Maybe FastString
-&gt; ModuleName
-&gt; IsBootInterface
-&gt; Bool
-&gt; IO (Maybe FilePath)
</span><a href="GHC.Driver.MakeFile.html#findDependency"><span class="hs-identifier hs-var">findDependency</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210781"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681210761"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681210759"><span class="hs-identifier hs-var">pkg_qual</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210758"><span class="hs-identifier hs-var">imp_mod</span></a></span><span>
</span><span id="line-212"></span><span>                                               </span><span class="annot"><span class="annottext">IsBootInterface
</span><a href="#local-6989586621681210760"><span class="hs-identifier hs-var">is_boot</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210774"><span class="hs-identifier hs-var">include_pkg_deps</span></a></span><span>
</span><span id="line-213"></span><span>                     </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621681210757"><span class="hs-identifier hs-var">mb_hi</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-214"></span><span>                           </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-215"></span><span>                           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681210755"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210755"><span class="hs-identifier hs-var">hi_file</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-216"></span><span>                     </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210754"><span class="annot"><span class="annottext">hi_files :: [FilePath]
</span><a href="#local-6989586621681210754"><span class="hs-identifier hs-var hs-var">hi_files</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; [FilePath] -&gt; [FilePath]
</span><a href="GHC.Driver.MakeFile.html#insertSuffixes"><span class="hs-identifier hs-var">insertSuffixes</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210755"><span class="hs-identifier hs-var">hi_file</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210775"><span class="hs-identifier hs-var">extra_suffixes</span></a></span><span>
</span><span id="line-217"></span><span>                           </span><span id="local-6989586621681210753"><span class="annot"><span class="annottext">write_dep :: (FilePath, FilePath) -&gt; IO ()
</span><a href="#local-6989586621681210753"><span class="hs-identifier hs-var hs-var">write_dep</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681210752"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210752"><span class="hs-identifier hs-var">obj</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681210751"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210751"><span class="hs-identifier hs-var">hi</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Handle -&gt; [FilePath] -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#writeDependency"><span class="hs-identifier hs-var">writeDependency</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210779"><span class="hs-identifier hs-var">root</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210778"><span class="hs-identifier hs-var">hdl</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210752"><span class="hs-identifier hs-var">obj</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210751"><span class="hs-identifier hs-var">hi</span></a></span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span>                        </span><span class="hs-comment">-- Add one dependency for each suffix;</span><span>
</span><span id="line-220"></span><span>                        </span><span class="hs-comment">-- e.g.         A.o   : B.hi</span><span>
</span><span id="line-221"></span><span>                        </span><span class="hs-comment">--              A.x_o : B.x_hi</span><span>
</span><span id="line-222"></span><span>                     </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">((FilePath, FilePath) -&gt; IO ()) -&gt; [(FilePath, FilePath)] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath, FilePath) -&gt; IO ()
</span><a href="#local-6989586621681210753"><span class="hs-identifier hs-var">write_dep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210768"><span class="hs-identifier hs-var">obj_files</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath] -&gt; [FilePath] -&gt; [(FilePath, FilePath)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210754"><span class="hs-identifier hs-var">hi_files</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span>                </span><span class="hs-comment">-- Emit std dependency of the object(s) on the source file</span><span>
</span><span id="line-226"></span><span>                </span><span class="hs-comment">-- Something like       A.o : A.hs</span><span>
</span><span id="line-227"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Handle -&gt; [FilePath] -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#writeDependency"><span class="hs-identifier hs-var">writeDependency</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210779"><span class="hs-identifier hs-var">root</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210778"><span class="hs-identifier hs-var">hdl</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210768"><span class="hs-identifier hs-var">obj_files</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210772"><span class="hs-identifier hs-var">src_file</span></a></span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span>          </span><span class="hs-comment">-- add dependency between objects and their corresponding .hi-boot</span><span>
</span><span id="line-230"></span><span>          </span><span class="hs-comment">-- files if the module has a corresponding .hs-boot file (#14482)</span><span>
</span><span id="line-231"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; IsBootInterface
</span><a href="GHC.Driver.Types.html#isBootSummary"><span class="hs-identifier hs-var">isBootSummary</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span><span> </span><span class="annot"><span class="annottext">IsBootInterface -&gt; IsBootInterface -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">IsBootInterface
</span><a href="GHC.Unit.Types.html#IsBoot"><span class="hs-identifier hs-var">IsBoot</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-232"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210747"><span class="annot"><span class="annottext">hi_boot :: FilePath
</span><a href="#local-6989586621681210747"><span class="hs-identifier hs-var hs-var">hi_boot</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; FilePath
</span><a href="GHC.Driver.Types.html#msHiFilePath"><span class="hs-identifier hs-var">msHiFilePath</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span><span>
</span><span id="line-233"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210745"><span class="annot"><span class="annottext">obj :: FilePath
</span><a href="#local-6989586621681210745"><span class="hs-identifier hs-var hs-var">obj</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="GHC.Unit.Module.Location.html#removeBootSuffix"><span class="hs-identifier hs-var">removeBootSuffix</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; FilePath
</span><a href="GHC.Driver.Types.html#msObjFilePath"><span class="hs-identifier hs-var">msObjFilePath</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>            </span><span class="annot"><span class="annottext">[FilePath] -&gt; (FilePath -&gt; IO ()) -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier hs-var">forM_</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210775"><span class="hs-identifier hs-var">extra_suffixes</span></a></span><span> </span><span class="annot"><span class="annottext">((FilePath -&gt; IO ()) -&gt; IO ()) -&gt; (FilePath -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681210743"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210743"><span class="hs-identifier hs-var">suff</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-235"></span><span>               </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210742"><span class="annot"><span class="annottext">way_obj :: [FilePath]
</span><a href="#local-6989586621681210742"><span class="hs-identifier hs-var hs-var">way_obj</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; [FilePath] -&gt; [FilePath]
</span><a href="GHC.Driver.MakeFile.html#insertSuffixes"><span class="hs-identifier hs-var">insertSuffixes</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210745"><span class="hs-identifier hs-var">obj</span></a></span><span>     </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210743"><span class="hs-identifier hs-var">suff</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-236"></span><span>               </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210741"><span class="annot"><span class="annottext">way_hi_boot :: [FilePath]
</span><a href="#local-6989586621681210741"><span class="hs-identifier hs-var hs-var">way_hi_boot</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; [FilePath] -&gt; [FilePath]
</span><a href="GHC.Driver.MakeFile.html#insertSuffixes"><span class="hs-identifier hs-var">insertSuffixes</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210747"><span class="hs-identifier hs-var">hi_boot</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210743"><span class="hs-identifier hs-var">suff</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-237"></span><span>               </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; [FilePath] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Handle -&gt; [FilePath] -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#writeDependency"><span class="hs-identifier hs-var">writeDependency</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210779"><span class="hs-identifier hs-var">root</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210778"><span class="hs-identifier hs-var">hdl</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210742"><span class="hs-identifier hs-var">way_obj</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210741"><span class="hs-identifier hs-var">way_hi_boot</span></a></span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span>                </span><span class="hs-comment">-- Emit a dependency for each CPP import</span><span>
</span><span id="line-240"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#depIncludeCppDeps"><span class="hs-identifier hs-var hs-var">depIncludeCppDeps</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210782"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-241"></span><span>            </span><span class="hs-comment">-- CPP deps are descovered in the module parsing phase by parsing</span><span>
</span><span id="line-242"></span><span>            </span><span class="hs-comment">-- comment lines left by the preprocessor.</span><span>
</span><span id="line-243"></span><span>            </span><span class="hs-comment">-- Note that GHC.parseModule may throw an exception if the module</span><span>
</span><span id="line-244"></span><span>            </span><span class="hs-comment">-- fails to parse, which may not be desirable (see #16616).</span><span>
</span><span id="line-245"></span><span>          </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681210739"><span class="annot"><span class="annottext">Session
</span><a href="#local-6989586621681210739"><span class="hs-identifier hs-var">session</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef HscEnv -&gt; Session
</span><a href="GHC.Driver.Monad.html#Session"><span class="hs-identifier hs-var">Session</span></a></span><span> </span><span class="annot"><span class="annottext">(IORef HscEnv -&gt; Session) -&gt; IO (IORef HscEnv) -&gt; IO Session
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO (IORef HscEnv)
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210781"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-246"></span><span>          </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681210735"><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681210735"><span class="hs-identifier hs-var">parsedMod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ghc ParsedModule -&gt; Session -&gt; IO ParsedModule
forall a. Ghc a -&gt; Session -&gt; IO a
</span><a href="GHC.Driver.Monad.html#reflectGhc"><span class="hs-identifier hs-var">reflectGhc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; Ghc ParsedModule
forall (m :: * -&gt; *). GhcMonad m =&gt; ModSummary -&gt; m ParsedModule
</span><a href="GHC.html#parseModule"><span class="hs-identifier hs-var">GHC.parseModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Session
</span><a href="#local-6989586621681210739"><span class="hs-identifier hs-var">session</span></a></span><span>
</span><span id="line-247"></span><span>          </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; [FilePath] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Handle -&gt; [FilePath] -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#writeDependency"><span class="hs-identifier hs-var">writeDependency</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210779"><span class="hs-identifier hs-var">root</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210778"><span class="hs-identifier hs-var">hdl</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210768"><span class="hs-identifier hs-var">obj_files</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParsedModule -&gt; [FilePath]
</span><a href="GHC.html#pm_extra_src_files"><span class="hs-identifier hs-var hs-var">GHC.pm_extra_src_files</span></a></span><span> </span><span class="annot"><span class="annottext">ParsedModule
</span><a href="#local-6989586621681210735"><span class="hs-identifier hs-var">parsedMod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span>          </span><span class="hs-special">}</span><span>
</span><span id="line-250"></span><span>
</span><span id="line-251"></span><span>                </span><span class="hs-comment">-- Emit a dependency for each import</span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210727"><span class="annot"><span class="annottext">do_imps :: IsBootInterface
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)] -&gt; IO ()
</span><a href="#local-6989586621681210727"><span class="hs-identifier hs-var hs-var">do_imps</span></a></span></span><span> </span><span id="local-6989586621681210726"><span class="annot"><span class="annottext">IsBootInterface
</span><a href="#local-6989586621681210726"><span class="hs-identifier hs-var">is_boot</span></a></span></span><span> </span><span id="local-6989586621681210725"><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681210725"><span class="hs-identifier hs-var">idecls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[IO ()] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, Monad m) =&gt;
t (m a) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#sequence_"><span class="hs-identifier hs-var">sequence_</span></a></span><span>
</span><span id="line-254"></span><span>                    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IsBootInterface -&gt; Maybe FastString -&gt; ModuleName -&gt; IO ()
</span><a href="#local-6989586621681210762"><span class="hs-identifier hs-var">do_imp</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681210723"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">IsBootInterface
</span><a href="#local-6989586621681210726"><span class="hs-identifier hs-var">is_boot</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681210722"><span class="hs-identifier hs-var">mb_pkg</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210721"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-255"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681210722"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681210722"><span class="hs-identifier hs-var">mb_pkg</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681210723"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681210723"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681210721"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210721"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681210725"><span class="hs-identifier hs-var">idecls</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-256"></span><span>                      </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210721"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; [ModuleName] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#notElem"><span class="hs-operator hs-var">`notElem`</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681210780"><span class="hs-identifier hs-var">excl_mods</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-257"></span><span>
</span><span id="line-258"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IsBootInterface
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)] -&gt; IO ()
</span><a href="#local-6989586621681210727"><span class="hs-identifier hs-var">do_imps</span></a></span><span> </span><span class="annot"><span class="annottext">IsBootInterface
</span><a href="GHC.Unit.Types.html#IsBoot"><span class="hs-identifier hs-var">IsBoot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_srcimps"><span class="hs-identifier hs-var hs-var">ms_srcimps</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IsBootInterface
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)] -&gt; IO ()
</span><a href="#local-6989586621681210727"><span class="hs-identifier hs-var">do_imps</span></a></span><span> </span><span class="annot"><span class="annottext">IsBootInterface
</span><a href="GHC.Unit.Types.html#NotBoot"><span class="hs-identifier hs-var">NotBoot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_imps"><span class="hs-identifier hs-var">ms_imps</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210776"><span class="hs-identifier hs-var">node</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#findDependency"><span class="hs-identifier hs-type">findDependency</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-264"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span>
</span><span id="line-265"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>     </span><span class="hs-comment">-- package qualifier, if any</span><span>
</span><span id="line-266"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>           </span><span class="hs-comment">-- Imported module</span><span>
</span><span id="line-267"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#IsBootInterface"><span class="hs-identifier hs-type">IsBootInterface</span></a></span><span>      </span><span class="hs-comment">-- Source import</span><span>
</span><span id="line-268"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                 </span><span class="hs-comment">-- Record dependency on package modules</span><span>
</span><span id="line-269"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Interface file</span><span>
</span><span id="line-270"></span><span id="findDependency"><span class="annot"><span class="annottext">findDependency :: HscEnv
-&gt; SrcSpan
-&gt; Maybe FastString
-&gt; ModuleName
-&gt; IsBootInterface
-&gt; Bool
-&gt; IO (Maybe FilePath)
</span><a href="GHC.Driver.MakeFile.html#findDependency"><span class="hs-identifier hs-var hs-var">findDependency</span></a></span></span><span> </span><span id="local-6989586621681210715"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210715"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681210714"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681210714"><span class="hs-identifier hs-var">srcloc</span></a></span></span><span> </span><span id="local-6989586621681210713"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681210713"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span id="local-6989586621681210712"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210712"><span class="hs-identifier hs-var">imp</span></a></span></span><span> </span><span id="local-6989586621681210711"><span class="annot"><span class="annottext">IsBootInterface
</span><a href="#local-6989586621681210711"><span class="hs-identifier hs-var">is_boot</span></a></span></span><span> </span><span id="local-6989586621681210710"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210710"><span class="hs-identifier hs-var">include_pkg_deps</span></a></span></span><span>
</span><span id="line-271"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span>       </span><span class="hs-comment">-- Find the module; this will be fast because</span><span>
</span><span id="line-272"></span><span>                </span><span class="hs-comment">-- we've done it once during downsweep</span><span>
</span><span id="line-273"></span><span>          </span><span id="local-6989586621681210709"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681210709"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findImportedModule"><span class="hs-identifier hs-var">findImportedModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210715"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210712"><span class="hs-identifier hs-var">imp</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681210713"><span class="hs-identifier hs-var">pkg</span></a></span><span>
</span><span id="line-274"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681210709"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-275"></span><span>            </span><span class="annot"><a href="GHC.Driver.Types.html#Found"><span class="hs-identifier hs-type">Found</span></a></span><span> </span><span id="local-6989586621681210706"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681210706"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="annot"><span class="annottext">Module
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-276"></span><span>                </span><span class="hs-comment">-- Home package: just depend on the .hi or hi-boot file</span><span>
</span><span id="line-277"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; Maybe FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var hs-var">ml_hs_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681210706"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210710"><span class="hs-identifier hs-var">include_pkg_deps</span></a></span><span>
</span><span id="line-278"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; IO (Maybe FilePath)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsBootInterface -&gt; FilePath -&gt; FilePath
</span><a href="GHC.Unit.Module.Location.html#addBootSuffix_maybe"><span class="hs-identifier hs-var">addBootSuffix_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">IsBootInterface
</span><a href="#local-6989586621681210711"><span class="hs-identifier hs-var">is_boot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hi_file"><span class="hs-identifier hs-var hs-var">ml_hi_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681210706"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span>                </span><span class="hs-comment">-- Not in this package: we don't need a dependency</span><span>
</span><span id="line-281"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-282"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; IO (Maybe FilePath)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span>            </span><span id="local-6989586621681210701"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681210701"><span class="hs-identifier hs-var">fail</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-285"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210700"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681210700"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210715"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-286"></span><span>                </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">ErrMsg -&gt; IO (Maybe FilePath)
forall (io :: * -&gt; *) a. MonadIO io =&gt; ErrMsg -&gt; io a
</span><a href="GHC.Driver.Types.html#throwOneError"><span class="hs-identifier hs-var">throwOneError</span></a></span><span> </span><span class="annot"><span class="annottext">(ErrMsg -&gt; IO (Maybe FilePath)) -&gt; ErrMsg -&gt; IO (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SrcSpan -&gt; MsgDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkPlainErrMsg"><span class="hs-identifier hs-var">mkPlainErrMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210700"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681210714"><span class="hs-identifier hs-var">srcloc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; ErrMsg) -&gt; MsgDoc -&gt; ErrMsg
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-287"></span><span>                        </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; FindResult -&gt; MsgDoc
</span><a href="GHC.Driver.Finder.html#cannotFindModule"><span class="hs-identifier hs-var">cannotFindModule</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210700"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210712"><span class="hs-identifier hs-var">imp</span></a></span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621681210701"><span class="hs-identifier hs-var">fail</span></a></span><span>
</span><span id="line-288"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span class="hs-comment">-----------------------------</span><span>
</span><span id="line-291"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#writeDependency"><span class="hs-identifier hs-type">writeDependency</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-292"></span><span class="hs-comment">-- (writeDependency r h [t1,t2] dep) writes to handle h the dependency</span><span>
</span><span id="line-293"></span><span class="hs-comment">--      t1 t2 : dep</span><span>
</span><span id="line-294"></span><span id="writeDependency"><span class="annot"><span class="annottext">writeDependency :: FilePath -&gt; Handle -&gt; [FilePath] -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#writeDependency"><span class="hs-identifier hs-var hs-var">writeDependency</span></a></span></span><span> </span><span id="local-6989586621681210695"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210695"><span class="hs-identifier hs-var">root</span></a></span></span><span> </span><span id="local-6989586621681210694"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210694"><span class="hs-identifier hs-var">hdl</span></a></span></span><span> </span><span id="local-6989586621681210693"><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210693"><span class="hs-identifier hs-var">targets</span></a></span></span><span> </span><span id="local-6989586621681210692"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210692"><span class="hs-identifier hs-var">dep</span></a></span></span><span>
</span><span id="line-295"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- We need to avoid making deps on</span><span>
</span><span id="line-296"></span><span>           </span><span class="hs-comment">--     c:/foo/...</span><span>
</span><span id="line-297"></span><span>           </span><span class="hs-comment">-- on cygwin as make gets confused by the :</span><span>
</span><span id="line-298"></span><span>           </span><span class="hs-comment">-- Making relative deps avoids some instances of this.</span><span>
</span><span id="line-299"></span><span>           </span><span id="local-6989586621681210691"><span class="annot"><span class="annottext">dep' :: FilePath
</span><a href="#local-6989586621681210691"><span class="hs-identifier hs-var hs-var">dep'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#makeRelative"><span class="hs-identifier hs-var">makeRelative</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210695"><span class="hs-identifier hs-var">root</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210692"><span class="hs-identifier hs-var">dep</span></a></span><span>
</span><span id="line-300"></span><span>           </span><span id="local-6989586621681210689"><span class="annot"><span class="annottext">forOutput :: FilePath -&gt; FilePath
</span><a href="#local-6989586621681210689"><span class="hs-identifier hs-var hs-var">forOutput</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="GHC.Utils.Misc.html#escapeSpaces"><span class="hs-identifier hs-var">escapeSpaces</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath)
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; FilePath
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Direction -&gt; FilePath -&gt; FilePath
</span><a href="GHC.Utils.Misc.html#reslash"><span class="hs-identifier hs-var">reslash</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="GHC.Utils.Misc.html#Forwards"><span class="hs-identifier hs-var">Forwards</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath)
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; FilePath
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#normalise"><span class="hs-identifier hs-var">normalise</span></a></span><span>
</span><span id="line-301"></span><span>           </span><span id="local-6989586621681210684"><span class="annot"><span class="annottext">output :: FilePath
</span><a href="#local-6989586621681210684"><span class="hs-identifier hs-var hs-var">output</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FilePath] -&gt; FilePath
</span><a href="../../base/src/Data.OldList.html#unwords"><span class="hs-identifier hs-var">unwords</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath) -&gt; [FilePath] -&gt; [FilePath]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="#local-6989586621681210689"><span class="hs-identifier hs-var">forOutput</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210693"><span class="hs-identifier hs-var">targets</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; : &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="#local-6989586621681210689"><span class="hs-identifier hs-var">forOutput</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210691"><span class="hs-identifier hs-var">dep'</span></a></span><span>
</span><span id="line-302"></span><span>       </span><span class="annot"><span class="annottext">Handle -&gt; FilePath -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStrLn"><span class="hs-identifier hs-var">hPutStrLn</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210694"><span class="hs-identifier hs-var">hdl</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210684"><span class="hs-identifier hs-var">output</span></a></span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="hs-comment">-----------------------------</span><span>
</span><span id="line-305"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#insertSuffixes"><span class="hs-identifier hs-type">insertSuffixes</span></a></span><span>
</span><span id="line-306"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>     </span><span class="hs-comment">-- Original filename;   e.g. &quot;foo.o&quot;</span><span>
</span><span id="line-307"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- Suffix prefixes      e.g. [&quot;x_&quot;, &quot;y_&quot;]</span><span>
</span><span id="line-308"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- Zapped filenames     e.g. [&quot;foo.x_o&quot;, &quot;foo.y_o&quot;]</span><span>
</span><span id="line-309"></span><span>        </span><span class="hs-comment">-- Note that the extra bit gets inserted *before* the old suffix</span><span>
</span><span id="line-310"></span><span>        </span><span class="hs-comment">-- We assume the old suffix contains no dots, so we know where to</span><span>
</span><span id="line-311"></span><span>        </span><span class="hs-comment">-- split it</span><span>
</span><span id="line-312"></span><span id="insertSuffixes"><span class="annot"><span class="annottext">insertSuffixes :: FilePath -&gt; [FilePath] -&gt; [FilePath]
</span><a href="GHC.Driver.MakeFile.html#insertSuffixes"><span class="hs-identifier hs-var hs-var">insertSuffixes</span></a></span></span><span> </span><span id="local-6989586621681210682"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210682"><span class="hs-identifier hs-var">file_name</span></a></span></span><span> </span><span id="local-6989586621681210681"><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210681"><span class="hs-identifier hs-var">extras</span></a></span></span><span>
</span><span id="line-313"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210680"><span class="hs-identifier hs-var">basename</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210678"><span class="hs-identifier hs-var">extra</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210677"><span class="hs-identifier hs-var">suffix</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681210678"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210678"><span class="hs-identifier hs-var">extra</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681210681"><span class="hs-identifier hs-var">extras</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-314"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-315"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681210680"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210680"><span class="hs-identifier hs-var">basename</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210677"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210677"><span class="hs-identifier hs-var">suffix</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; (FilePath, FilePath)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtension"><span class="hs-identifier hs-var">splitExtension</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210682"><span class="hs-identifier hs-var">file_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-316"></span><span>                         </span><span class="hs-comment">-- Drop the &quot;.&quot; from the extension</span><span>
</span><span id="line-317"></span><span>                         </span><span class="hs-special">(</span><span id="local-6989586621681210675"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210675"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210674"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210674"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210675"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; FilePath -&gt; FilePath
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#drop"><span class="hs-identifier hs-var">drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210674"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-321"></span><span class="hs-comment">--</span><span>
</span><span id="line-322"></span><span class="hs-comment">--              endMkDependHs</span><span>
</span><span id="line-323"></span><span class="hs-comment">--      Complete the makefile, close the tmp file etc</span><span>
</span><span id="line-324"></span><span class="hs-comment">--</span><span>
</span><span id="line-325"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#endMkDependHS"><span class="hs-identifier hs-type">endMkDependHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.MakeFile.html#MkDepFiles"><span class="hs-identifier hs-type">MkDepFiles</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span id="endMkDependHS"><span class="annot"><span class="annottext">endMkDependHS :: DynFlags -&gt; MkDepFiles -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#endMkDependHS"><span class="hs-identifier hs-var hs-var">endMkDependHS</span></a></span></span><span> </span><span id="local-6989586621681210672"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210672"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>
</span><span id="line-330"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.MakeFile.html#MkDep"><span class="hs-identifier hs-type">MkDep</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mkd_make_file :: MkDepFiles -&gt; FilePath
</span><a href="GHC.Driver.MakeFile.html#mkd_make_file"><span class="hs-identifier hs-var">mkd_make_file</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681210671"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210671"><span class="hs-identifier hs-var">makefile</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mkd_make_hdl :: MkDepFiles -&gt; Maybe Handle
</span><a href="GHC.Driver.MakeFile.html#mkd_make_hdl"><span class="hs-identifier hs-var">mkd_make_hdl</span></a></span><span> </span><span class="hs-glyph">=</span><span>  </span><span id="local-6989586621681210670"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621681210670"><span class="hs-identifier hs-var">makefile_hdl</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-331"></span><span>            </span><span class="annot"><span class="annottext">mkd_tmp_file :: MkDepFiles -&gt; FilePath
</span><a href="GHC.Driver.MakeFile.html#mkd_tmp_file"><span class="hs-identifier hs-var">mkd_tmp_file</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681210669"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210669"><span class="hs-identifier hs-var">tmp_file</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mkd_tmp_hdl :: MkDepFiles -&gt; Handle
</span><a href="GHC.Driver.MakeFile.html#mkd_tmp_hdl"><span class="hs-identifier hs-var">mkd_tmp_hdl</span></a></span><span>  </span><span class="hs-glyph">=</span><span>  </span><span id="local-6989586621681210668"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210668"><span class="hs-identifier hs-var">tmp_hdl</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-333"></span><span>  </span><span class="hs-comment">-- write the magic marker into the tmp file</span><span>
</span><span id="line-334"></span><span>  </span><span class="annot"><span class="annottext">Handle -&gt; FilePath -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStrLn"><span class="hs-identifier hs-var">hPutStrLn</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210668"><span class="hs-identifier hs-var">tmp_hdl</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="GHC.Driver.MakeFile.html#depEndMarker"><span class="hs-identifier hs-var">depEndMarker</span></a></span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621681210670"><span class="hs-identifier hs-var">makefile_hdl</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-337"></span><span>     </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span>     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681210667"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210667"><span class="hs-identifier hs-var">hdl</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-339"></span><span>
</span><span id="line-340"></span><span>          </span><span class="hs-comment">-- slurp the rest of the original makefile and copy it into the output</span><span>
</span><span id="line-341"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210664"><span class="annot"><span class="annottext">slurp :: IO b
</span><a href="#local-6989586621681210664"><span class="hs-identifier hs-var hs-var">slurp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-342"></span><span>                </span><span id="local-6989586621681210663"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210663"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO FilePath
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hGetLine"><span class="hs-identifier hs-var">hGetLine</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210667"><span class="hs-identifier hs-var">hdl</span></a></span><span>
</span><span id="line-343"></span><span>                </span><span class="annot"><span class="annottext">Handle -&gt; FilePath -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStrLn"><span class="hs-identifier hs-var">hPutStrLn</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210668"><span class="hs-identifier hs-var">tmp_hdl</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210663"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-344"></span><span>                </span><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621681210664"><span class="hs-identifier hs-var">slurp</span></a></span><span>
</span><span id="line-345"></span><span>
</span><span id="line-346"></span><span>        </span><span class="annot"><span class="annottext">IO () -&gt; (IOException -&gt; IO ()) -&gt; IO ()
forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="GHC.Utils.Exception.html#catchIO"><span class="hs-identifier hs-var">catchIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO ()
forall {b}. IO b
</span><a href="#local-6989586621681210664"><span class="hs-identifier hs-var">slurp</span></a></span><span>
</span><span id="line-347"></span><span>                </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681210662"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210662"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isEOFError"><span class="hs-identifier hs-var">isEOFError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210662"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621681210662"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span>
</span><span id="line-349"></span><span>        </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210667"><span class="hs-identifier hs-var">hdl</span></a></span><span>
</span><span id="line-350"></span><span>
</span><span id="line-351"></span><span>  </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681210668"><span class="hs-identifier hs-var">tmp_hdl</span></a></span><span>  </span><span class="hs-comment">-- make sure it's flushed</span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span>        </span><span class="hs-comment">-- Create a backup of the original makefile</span><span>
</span><span id="line-354"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621681210670"><span class="hs-identifier hs-var">makefile_hdl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; FilePath -&gt; FilePath -&gt; IO ()
</span><a href="GHC.SysTools.html#copy"><span class="hs-identifier hs-var">SysTools.copy</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210672"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Backing up &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210671"><span class="hs-identifier hs-var">makefile</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-356"></span><span>          </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210671"><span class="hs-identifier hs-var">makefile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210671"><span class="hs-identifier hs-var">makefile</span></a></span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;.bak&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span>        </span><span class="hs-comment">-- Copy the new makefile in place</span><span>
</span><span id="line-359"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; FilePath -&gt; FilePath -&gt; IO ()
</span><a href="GHC.SysTools.html#copy"><span class="hs-identifier hs-var">SysTools.copy</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210672"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Installing new makefile&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210669"><span class="hs-identifier hs-var">tmp_file</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210671"><span class="hs-identifier hs-var">makefile</span></a></span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-363"></span><span class="hs-comment">--              Module cycles</span><span>
</span><span id="line-364"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#dumpModCycles"><span class="hs-identifier hs-type">dumpModCycles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModuleGraph"><span class="hs-identifier hs-type">ModuleGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span id="dumpModCycles"><span class="annot"><span class="annottext">dumpModCycles :: DynFlags -&gt; ModuleGraph -&gt; IO ()
</span><a href="GHC.Driver.MakeFile.html#dumpModCycles"><span class="hs-identifier hs-var hs-var">dumpModCycles</span></a></span></span><span> </span><span id="local-6989586621681210659"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210659"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681210658"><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681210658"><span class="hs-identifier hs-var">module_graph</span></a></span></span><span>
</span><span id="line-368"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DumpFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#dopt"><span class="hs-identifier hs-var">dopt</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_mod_cycles"><span class="hs-identifier hs-var">Opt_D_dump_mod_cycles</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210659"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-369"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-370"></span><span>
</span><span id="line-371"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[[ModSummary]] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[[ModSummary]]
</span><a href="#local-6989586621681210655"><span class="hs-identifier hs-var">cycles</span></a></span><span>
</span><span id="line-372"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#putMsg"><span class="hs-identifier hs-var">putMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210659"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;No module cycles&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-375"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#putMsg"><span class="hs-identifier hs-var">putMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210659"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Module cycles found:&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681210652"><span class="hs-identifier hs-var">pp_cycles</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span>    </span><span class="annot"><a href="#local-6989586621681210655"><span class="hs-identifier hs-type">cycles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span class="hs-special">]</span><span class="hs-special">]</span><span>
</span><span id="line-379"></span><span>    </span><span id="local-6989586621681210655"><span class="annot"><span class="annottext">cycles :: [[ModSummary]]
</span><a href="#local-6989586621681210655"><span class="hs-identifier hs-var hs-var">cycles</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-380"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210651"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span id="local-6989586621681210651"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210651"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; ModuleGraph -&gt; Maybe ModuleName -&gt; [SCC ModSummary]
</span><a href="GHC.Driver.Make.html#topSortModuleGraph"><span class="hs-identifier hs-var">GHC.topSortModuleGraph</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681210658"><span class="hs-identifier hs-var">module_graph</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-381"></span><span>
</span><span id="line-382"></span><span>    </span><span id="local-6989586621681210652"><span class="annot"><span class="annottext">pp_cycles :: MsgDoc
</span><a href="#local-6989586621681210652"><span class="hs-identifier hs-var hs-var">pp_cycles</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;---------- Cycle&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681210643"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;----------&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-383"></span><span>                        </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary] -&gt; MsgDoc
</span><a href="GHC.Driver.MakeFile.html#pprCycle"><span class="hs-identifier hs-var">pprCycle</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210639"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#blankLine"><span class="hs-identifier hs-var">blankLine</span></a></span><span>
</span><span id="line-384"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681210643"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681210643"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681210639"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210639"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; [[ModSummary]] -&gt; [(Int, [ModSummary])]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[[ModSummary]]
</span><a href="#local-6989586621681210655"><span class="hs-identifier hs-var">cycles</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-385"></span><span>
</span><span id="line-386"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#pprCycle"><span class="hs-identifier hs-type">pprCycle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-387"></span><span class="hs-comment">-- Print a cycle, but show only the imports within the cycle</span><span>
</span><span id="line-388"></span><span id="pprCycle"><span class="annot"><span class="annottext">pprCycle :: [ModSummary] -&gt; MsgDoc
</span><a href="GHC.Driver.MakeFile.html#pprCycle"><span class="hs-identifier hs-var hs-var">pprCycle</span></a></span></span><span> </span><span id="local-6989586621681210636"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210636"><span class="hs-identifier hs-var">summaries</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SCC ModSummary -&gt; MsgDoc
</span><a href="#local-6989586621681210635"><span class="hs-identifier hs-var">pp_group</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ModSummary] -&gt; SCC ModSummary
forall vertex. [vertex] -&gt; SCC vertex
</span><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-var">CyclicSCC</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210636"><span class="hs-identifier hs-var">summaries</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-390"></span><span>    </span><span class="annot"><a href="#local-6989586621681210634"><span class="hs-identifier hs-type">cycle_mods</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- The modules in this cycle</span><span>
</span><span id="line-391"></span><span>    </span><span id="local-6989586621681210634"><span class="annot"><span class="annottext">cycle_mods :: [ModuleName]
</span><a href="#local-6989586621681210634"><span class="hs-identifier hs-var hs-var">cycle_mods</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ModSummary -&gt; ModuleName) -&gt; [ModSummary] -&gt; [ModuleName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">(Module -&gt; ModuleName)
-&gt; (ModSummary -&gt; Module) -&gt; ModSummary -&gt; ModuleName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; Module
</span><a href="GHC.Driver.Types.html#ms_mod"><span class="hs-identifier hs-var hs-var">ms_mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210636"><span class="hs-identifier hs-var">summaries</span></a></span><span>
</span><span id="line-392"></span><span>
</span><span id="line-393"></span><span>    </span><span id="local-6989586621681210635"><span class="annot"><span class="annottext">pp_group :: SCC ModSummary -&gt; MsgDoc
</span><a href="#local-6989586621681210635"><span class="hs-identifier hs-var hs-var">pp_group</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#AcyclicSCC"><span class="hs-identifier hs-type">AcyclicSCC</span></a></span><span> </span><span id="local-6989586621681210630"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210630"><span class="hs-identifier hs-var">ms</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; MsgDoc
</span><a href="#local-6989586621681210629"><span class="hs-identifier hs-var">pp_ms</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210630"><span class="hs-identifier hs-var">ms</span></a></span><span>
</span><span id="line-394"></span><span>    </span><span class="annot"><a href="#local-6989586621681210635"><span class="hs-identifier hs-var">pp_group</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span id="local-6989586621681210628"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210628"><span class="hs-identifier hs-var">mss</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">boot_only</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-396"></span><span>                </span><span class="hs-comment">-- The boot-only list must be non-empty, else there would</span><span>
</span><span id="line-397"></span><span>                </span><span class="hs-comment">-- be an infinite chain of non-boot imports, and we've</span><span>
</span><span id="line-398"></span><span>                </span><span class="hs-comment">-- already checked for that in processModDeps</span><span>
</span><span id="line-399"></span><span>          </span><span class="annot"><span class="annottext">ModSummary -&gt; MsgDoc
</span><a href="#local-6989586621681210629"><span class="hs-identifier hs-var">pp_ms</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210623"><span class="hs-identifier hs-var">loop_breaker</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(SCC ModSummary -&gt; MsgDoc) -&gt; [SCC ModSummary] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">SCC ModSummary -&gt; MsgDoc
</span><a href="#local-6989586621681210635"><span class="hs-identifier hs-var">pp_group</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC ModSummary]
</span><a href="#local-6989586621681210622"><span class="hs-identifier hs-var">groups</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-401"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681210625"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210625"><span class="hs-identifier hs-var">boot_only</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210621"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210621"><span class="hs-identifier hs-var">others</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ModSummary -&gt; Bool)
-&gt; [ModSummary] -&gt; ([ModSummary], [ModSummary])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; Bool
</span><a href="#local-6989586621681210619"><span class="hs-identifier hs-var">is_boot_only</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210628"><span class="hs-identifier hs-var">mss</span></a></span><span>
</span><span id="line-402"></span><span>          </span><span id="local-6989586621681210619"><span class="annot"><span class="annottext">is_boot_only :: ModSummary -&gt; Bool
</span><a href="#local-6989586621681210619"><span class="hs-identifier hs-var hs-var">is_boot_only</span></a></span></span><span> </span><span id="local-6989586621681210617"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210617"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GenLocated SrcSpan ModuleName -&gt; Bool)
-&gt; [GenLocated SrcSpan ModuleName] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName -&gt; Bool
forall {l}. GenLocated l ModuleName -&gt; Bool
</span><a href="#local-6989586621681210615"><span class="hs-identifier hs-var">in_group</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Maybe FastString, GenLocated SrcSpan ModuleName)
 -&gt; GenLocated SrcSpan ModuleName)
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [GenLocated SrcSpan ModuleName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe FastString, GenLocated SrcSpan ModuleName)
-&gt; GenLocated SrcSpan ModuleName
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_imps"><span class="hs-identifier hs-var">ms_imps</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210617"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-403"></span><span>          </span><span id="local-6989586621681210615"><span class="annot"><span class="annottext">in_group :: GenLocated l ModuleName -&gt; Bool
</span><a href="#local-6989586621681210615"><span class="hs-identifier hs-var hs-var">in_group</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681210612"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210612"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210612"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; [ModuleName] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681210610"><span class="hs-identifier hs-var">group_mods</span></a></span><span>
</span><span id="line-404"></span><span>          </span><span id="local-6989586621681210610"><span class="annot"><span class="annottext">group_mods :: [ModuleName]
</span><a href="#local-6989586621681210610"><span class="hs-identifier hs-var hs-var">group_mods</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ModSummary -&gt; ModuleName) -&gt; [ModSummary] -&gt; [ModuleName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">(Module -&gt; ModuleName)
-&gt; (ModSummary -&gt; Module) -&gt; ModSummary -&gt; ModuleName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; Module
</span><a href="GHC.Driver.Types.html#ms_mod"><span class="hs-identifier hs-var hs-var">ms_mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210628"><span class="hs-identifier hs-var">mss</span></a></span><span>
</span><span id="line-405"></span><span>
</span><span id="line-406"></span><span>          </span><span id="local-6989586621681210623"><span class="annot"><span class="annottext">loop_breaker :: ModSummary
</span><a href="#local-6989586621681210623"><span class="hs-identifier hs-var hs-var">loop_breaker</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ModSummary] -&gt; ModSummary
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210625"><span class="hs-identifier hs-var">boot_only</span></a></span><span>
</span><span id="line-407"></span><span>          </span><span id="local-6989586621681210608"><span class="annot"><span class="annottext">all_others :: [ModSummary]
</span><a href="#local-6989586621681210608"><span class="hs-identifier hs-var hs-var">all_others</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ModSummary] -&gt; [ModSummary]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210625"><span class="hs-identifier hs-var">boot_only</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary] -&gt; [ModSummary] -&gt; [ModSummary]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210621"><span class="hs-identifier hs-var">others</span></a></span><span>
</span><span id="line-408"></span><span>          </span><span id="local-6989586621681210622"><span class="annot"><span class="annottext">groups :: [SCC ModSummary]
</span><a href="#local-6989586621681210622"><span class="hs-identifier hs-var hs-var">groups</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-409"></span><span>            </span><span class="annot"><span class="annottext">Bool -&gt; ModuleGraph -&gt; Maybe ModuleName -&gt; [SCC ModSummary]
</span><a href="GHC.Driver.Make.html#topSortModuleGraph"><span class="hs-identifier hs-var">GHC.topSortModuleGraph</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ModSummary] -&gt; ModuleGraph
</span><a href="GHC.Driver.Types.html#mkModuleGraph"><span class="hs-identifier hs-var">mkModuleGraph</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681210608"><span class="hs-identifier hs-var">all_others</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span>    </span><span id="local-6989586621681210629"><span class="annot"><span class="annottext">pp_ms :: ModSummary -&gt; MsgDoc
</span><a href="#local-6989586621681210629"><span class="hs-identifier hs-var hs-var">pp_ms</span></a></span></span><span> </span><span id="local-6989586621681210602"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210602"><span class="hs-identifier hs-var">summary</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210601"><span class="hs-identifier hs-var">mod_str</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; FilePath -&gt; FilePath
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#take"><span class="hs-identifier hs-var">take</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">20</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681210601"><span class="hs-identifier hs-var">mod_str</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; FilePath
forall a. a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#repeat"><span class="hs-identifier hs-var">repeat</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-412"></span><span>                       </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; [GenLocated SrcSpan ModuleName] -&gt; MsgDoc
</span><a href="#local-6989586621681210596"><span class="hs-identifier hs-var">pp_imps</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Maybe FastString, GenLocated SrcSpan ModuleName)
 -&gt; GenLocated SrcSpan ModuleName)
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [GenLocated SrcSpan ModuleName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe FastString, GenLocated SrcSpan ModuleName)
-&gt; GenLocated SrcSpan ModuleName
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_imps"><span class="hs-identifier hs-var">ms_imps</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210602"><span class="hs-identifier hs-var">summary</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-413"></span><span>                            </span><span class="annot"><span class="annottext">MsgDoc -&gt; [GenLocated SrcSpan ModuleName] -&gt; MsgDoc
</span><a href="#local-6989586621681210596"><span class="hs-identifier hs-var">pp_imps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;{-# SOURCE #-}&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Maybe FastString, GenLocated SrcSpan ModuleName)
 -&gt; GenLocated SrcSpan ModuleName)
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [GenLocated SrcSpan ModuleName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe FastString, GenLocated SrcSpan ModuleName)
-&gt; GenLocated SrcSpan ModuleName
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_srcimps"><span class="hs-identifier hs-var hs-var">ms_srcimps</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210602"><span class="hs-identifier hs-var">summary</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-414"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-415"></span><span>          </span><span id="local-6989586621681210601"><span class="annot"><span class="annottext">mod_str :: FilePath
</span><a href="#local-6989586621681210601"><span class="hs-identifier hs-var hs-var">mod_str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; FilePath
</span><a href="GHC.Unit.Module.Name.html#moduleNameString"><span class="hs-identifier hs-var">moduleNameString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; Module
</span><a href="GHC.Driver.Types.html#ms_mod"><span class="hs-identifier hs-var hs-var">ms_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681210602"><span class="hs-identifier hs-var">summary</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-416"></span><span>
</span><span id="line-417"></span><span>    </span><span class="annot"><a href="#local-6989586621681210596"><span class="hs-identifier hs-type">pp_imps</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-418"></span><span>    </span><span id="local-6989586621681210596"><span class="annot"><span class="annottext">pp_imps :: MsgDoc -&gt; [GenLocated SrcSpan ModuleName] -&gt; MsgDoc
</span><a href="#local-6989586621681210596"><span class="hs-identifier hs-var hs-var">pp_imps</span></a></span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-419"></span><span>    </span><span class="annot"><a href="#local-6989586621681210596"><span class="hs-identifier hs-var">pp_imps</span></a></span><span> </span><span id="local-6989586621681210592"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681210592"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span id="local-6989586621681210591"><span class="annot"><span class="annottext">[GenLocated SrcSpan ModuleName]
</span><a href="#local-6989586621681210591"><span class="hs-identifier hs-var">lms</span></a></span></span><span>
</span><span id="line-420"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210590"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681210590"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210590"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan ModuleName]
</span><a href="#local-6989586621681210591"><span class="hs-identifier hs-var">lms</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681210590"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; [ModuleName] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681210634"><span class="hs-identifier hs-var">cycle_mods</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-421"></span><span>            </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-422"></span><span>            </span><span id="local-6989586621681210589"><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681210589"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681210592"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;imports&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-423"></span><span>                                </span><span class="annot"><span class="annottext">(ModuleName -&gt; MsgDoc) -&gt; [ModuleName] -&gt; MsgDoc
forall a. (a -&gt; MsgDoc) -&gt; [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#pprWithCommas"><span class="hs-identifier hs-var">pprWithCommas</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681210589"><span class="hs-identifier hs-var">ms</span></a></span><span>
</span><span id="line-424"></span><span>
</span><span id="line-425"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-426"></span><span class="hs-comment">--</span><span>
</span><span id="line-427"></span><span class="hs-comment">--              Flags</span><span>
</span><span id="line-428"></span><span class="hs-comment">--</span><span>
</span><span id="line-429"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="annot"><a href="GHC.Driver.MakeFile.html#depStartMarker"><span class="hs-identifier hs-type">depStartMarker</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.MakeFile.html#depEndMarker"><span class="hs-identifier hs-type">depEndMarker</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-432"></span><span id="depStartMarker"><span class="annot"><span class="annottext">depStartMarker :: FilePath
</span><a href="GHC.Driver.MakeFile.html#depStartMarker"><span class="hs-identifier hs-var hs-var">depStartMarker</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;# DO NOT DELETE: Beginning of Haskell dependencies&quot;</span></span><span>
</span><span id="line-433"></span><span id="depEndMarker"><span class="annot"><span class="annottext">depEndMarker :: FilePath
</span><a href="GHC.Driver.MakeFile.html#depEndMarker"><span class="hs-identifier hs-var hs-var">depEndMarker</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;# DO NOT DELETE: End of Haskell dependencies&quot;</span></span><span>
</span><span id="line-434"></span><span>
</span><span id="line-435"></span></pre></body></html>